<template>
	<view>
		<view class="goods">
			</view>
		<view class="control">
			<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem"
			style-type="button" active-color="#3472d4"></uni-segmented-control>
			<view class="content">
				<view v-show="current == 0">
					<!-- <view class="jc" v-for="item in list"> -->
							
						<uni-card v-for="item in list" @click="oo(item.jourid)">
							<view>{{item.theme}}</view>
							<view>{{item.content}}</view>
						</uni-card>
				</view>
				<view v-show="current == 1">
					<view class="cj">
						<uni-card v-for="item in lists" >
							
							<view class="tag-view"  style="float: right;">
								<uni-tag text="放假通知" type="primary" size="small" ></uni-tag>
							</view>
							
							<text>{{item.noticeName}}</text></br>
<!-- 							<text>{{item.noticeid}}</text>
							<text>{{item.noticeid}}</text> -->
							<view>
								<text>{{item.announcement}}</text>
							</view></br>
							<view>
								<text>{{item.serrName}}</text>
								<text style="float: right;">{{item.createTime}}</text>
							</view>
							
								
							
						 </uni-card>
					</view>
				</view>
			</view>
		</view>
		<view>
			
		</view>
	</view>
</template>

<script>
	import uniSegametedCintrol from"@/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue"
	export default {
		components:{
			uniSegametedCintrol
		},
		data() {
			
			return {
				lists:[],
				user:{},
				eid:'',
				list:[],
			    items: ['新闻', '公告'],
				current: 0,
				value1: 0,
			}
		},
		onLoad() {
			this.a();
			this.getAll();
			this.getAA();
		},
		methods: {
			oo(jourid){
				uni.reLaunch({
					url: 'gonggao?jourid='+jourid
				})
			},
			getAA(){
				uni.request({
					url:'http://localhost:8003/userproject/l/listde?eid='+this.eid,
					method:'POST',
					success:(res)=> {
						this.lists=res.data.data.list
						console.log(this.lists)
					}
				})
			},
			getAll(){
				uni.request({
					url:'http://localhost:8003/userproject/l/list/'+this.eid,
					method:'get',
					success:(res)=> {
						this.list=res.data.data.list
						console.log(this.list)
					}
				})
			},
			a(){
				this.user=uni.getStorageSync('user')
				console.log(this.user)
				this.eid=this.user.eid
				console.log(this.eid)
			},
			onClickItem(e){
				if(this.current !== e.current){
					this.current = e.currentIndex;
				}
			},
			click1(e) {
				console.log('click1', e);
		}

}
	}
</script>

<style>
	.txt{
		margin-left:10rpx;
		margin-top: 10rpx;
		float:left;
	}
	.txt1{
		margin-left:50rpx;
		margin-top: 10rpx;
		float:left;
	}
	.zt{
		margin-top: -48rpx;
		margin-left:180rpx;
		position:relative;
		z-index: index auto;
		
	}
	.txt-line2{
		margin-top: 50rpx;
		margin-left:10rpx;
	}
	.ztt{
		margin-top: -45rpx;
		margin-left:210rpx;
		position:relative;
		z-index: 50;
		color: #ffd67a;
		font-family:cursive;
		font-weight:bold;
	}
	.goods-left {
		margin-top: 60rpx;
		
	}
	
	.goods-right {
		display: flex;
		flex-direction: column;
		justify-content: space-between;
	}
	.goods {
		background-color: #fff;
		padding: 30rpx;
		padding-bottom: 20rpx;
		display: flex;
		height: 140px;
	}
	.control{
		margin-top: -20rpx;
	}
	.jc{
		margin-top: 50rpx;
		margin-left: 20px;
	}
	.jct1{
		margin-top: 20rpx;
	}
	.jct2{
		margin-top: -40rpx;
		margin-left: 100px;
	}
	.ct{
		margin-top: 50rpx;
	}
	.cj{
		margin-top: -20rpx;
	}
	.ct2{
		margin-top:5px
	}
</style>
